View this information on an interactive table.
Go to Oregon Department of Education (ODE) Covid-19 Resources webpage.
---
title: "Oregon Map of Adult Mask Noncompliance and Risk of Harmful Response to Student Mask Noncompliance"
author: "Rebecca Amodeo"
output:
flexdashboard::flex_dashboard:
orientation: rows
social: menu
source_code: embed
---
```{r setup, include=FALSE}
pacman::p_load(plotly, maps, readr, dplyr, ggthemes, ggrepel, ggfittext)
knitr::opts_chunk$set(message = FALSE)
```
Row {data-height=800}
------------------------------------------------------------------------------
### Oregon Adult Mask Noncompliance and Risk of Harmful Response to Student Mask Noncompliance
```{r}
nicedf <- read_csv("C:/My_R/crime_health_sp_2020/data/nicedf.csv")
nicetable <- nicedf %>%
select(-c(X1, fips, county_rank_in_healthcare_for_kids))
cou_map <- map_data("county", "oregon")
cou_map <- cou_map %>%
select(-region) %>%
rename(county_name = subregion)
st_map <- map_data("state", "oregon")
choropleth <- merge(cou_map, nicetable, by = "county_name")
choropleth <- choropleth[order(choropleth$order), ]
# provide a custom tooltip to plotly with the county name and actual rate
choropleth$County <- with(choropleth, county_name)
p <- ggplot(choropleth, aes(long, lat, group = group)) +
geom_polygon(aes(fill= county_rank_in_adult_mask_use),
colour = alpha("white", 1/2), size = 0.2) +
# geom_fit_text(reflow = TRUE, grow = TRUE, contrast = TRUE, label = TRUE) +
geom_polygon(data = st_map, colour = "white",
fill = NA) +
scale_fill_viridis_c(
name = "County Rank in Adult Masking",
alpha = 1,
# begin = 0,
# end = 1,
# direction = 1,
option = "cividis")
# style(p, hoverinfo = "none", tooltip = "text")
# just show the text aesthetic in the tooltip
ggplotly(p, hover = "County", legend = TRUE) %>% layout(legend = FALSE)
```
Row {data-height=200}
------------------------------------------------------------------------------
### Other Resources
View this information on an [interactive table](insert-link).
Go to Oregon Department of Education (ODE) [Covid-19 Resources webpage](insert-link).